<?php

namespace sil29\VitrineBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller {
	public function indexAction() {
		return $this->render ( 'sil29VitrineBundle:Default:index.html.twig', array ());
	}
	public function repasParCategorieAction($idCategorie,$idType='0',$order='asc') {
		$listeRepas = $this->getDoctrine ()->getManager() ->getRepository('sil29VitrineBundle:ElementFacturable')->findByCategorieOrdenedByName($idCategorie,$idType,$order);
		$categorie = $this->getDoctrine ()->getManager ()->getRepository ( 'sil29VitrineBundle:Categorie' )->find ( $idCategorie );
		return $this->render ( 'sil29VitrineBundle:Default:repas.html.twig', array (
				'listeRepas' => $listeRepas,
				'idCategorieOuverte' => $categorie->getId(),
				'categorie' => $categorie 
		) );
	}
}
